Added a flake for build and packaging on Nix/NixOS. - #149
deephack1982 wants to merge 3 commits into
Conversation
|
Okay had to patch this up a bit as I included the wrong td :-D NixOS snippet is now this. inputs = {
sidecar.url = "github:deephack1982/sidecar";
## more inputs
};
environment.systemPackages = with pkgs; [
inputs.sidecar.packages.${pkgs.stdenv.hostPlatform.system}.sidecar
inputs.sidecar.packages.${pkgs.stdenv.hostPlatform.system}.td
] |
marcus
left a comment
There was a problem hiding this comment.
Hey @deephack1982 — thanks so much for this! NixOS support is genuinely useful for the community and the flake structure looks solid overall. Really appreciate you tracking down and fixing the wrong-td issue too.
A couple of things to address before we merge:
1. td version mismatch (important)
The flake pins td at v0.33.0, but sidecar's go.mod requires github.com/marcus/td v0.38.0 (latest is v0.39.0). A user installing both packages from this flake would get an older td CLI than what sidecar was built against, which is confusing. Could you bump this to v0.38.0 (or v0.39.0) with updated sha256 and vendorHash?
2. Deprecated defaultPackage output
The top-level defaultPackage attribute has been deprecated since Nix 2.7 in favour of packages.<system>.default — which you already have. You can just remove these lines:
defaultPackage = forAllSystems (system: self.packages.${system}.sidecar);Everything else looks good — the buildGoModule setup, subPackages, ldflags, forAllSystems pattern, and the lock file are all correct. Once those two things are sorted I'm happy to merge.
|
Thanks for the feedback Marcus. I'll revise this later today and update the PR. |
|
Hey! Starling here (AI assistant on the project). 👋 Sounds great — looking forward to the revision. The Nix flake contribution is a nice addition for the NixOS crowd. Take your time, and feel free to ping here when it's updated. ✦ |
|
Hi @deephack1982, I am closing this, and since I am the one who said I was happy to merge it back in March, the reversal deserves an explanation. The two changes I asked for never landed, but that is not really the reason. What changed my mind is thinking properly about what carrying a flake in this repo costs over time. The part I cannot solve is that nobody working on Sidecar runs Nix. A broken flake would sit broken until a NixOS user filed an issue, and I would have no way to verify a fix. I would rather not ship a packaging path I cannot test. The good news is that nothing here is lost. The consumption pattern from your own description already works without this repo carrying anything: inputs.sidecar.url = "github:deephack1982/sidecar";A flake in your fork, or in a small standalone repo, gives NixOS users the same install, and you get to bump the pins on your schedule rather than mine. If that picks up users and you would like it linked from the README as a community package, I would happily take that PR. Thanks for building it, and sorry for the reversal. |
Created a simple flake which can build and install sidecar on Nix/NixOS environments just in case you want that. To locally build and test simply run
To add to your NixOS system you can add an input and include the default package like this.